Skip to content

Feature/improve monitor#7

Merged
kenchou merged 3 commits intomainfrom
feature/improve-monitor
Jun 21, 2025
Merged

Feature/improve monitor#7
kenchou merged 3 commits intomainfrom
feature/improve-monitor

Conversation

@kenchou
Copy link
Owner

@kenchou kenchou commented Jun 21, 2025

Core Changes Made:

  1. Added OS Detection and File Watching Support

    • Introduced detect_file_watcher function to check for available tools (inotifywait or fswatch) based on the system.
  2. Implemented Directory Stability Check

    • Added wait_for_directory_stable function to ensure directories are stable before processing, reducing false positives from incomplete file operations.
  3. Refactored Monitoring Logic

    • Rewrote the main monitoring loop to handle both Linux/macOS systems using appropriate tools.
    • Added error handling and stability checks before processing files.

Direct Impact:

  1. Improved Cross-Platform Compatibility

    • The script now works on both Linux (using inotifywait) and macOS (using fswatch).
  2. Reduced False Triggers

    • By waiting for directory stability, the script avoids processing incomplete file operations, leading to more accurate results.
  3. Enhanced Error Handling

    • Provides clear feedback when monitoring tools are missing and suggests installation commands, improving user experience.
  4. More Robust File Processing

    • The script now properly handles directory events (e.g., moves) and ensures files are processed only after their state stabilizes.

@kenchou kenchou merged commit a62acf2 into main Jun 21, 2025
1 check passed
@kenchou kenchou deleted the feature/improve-monitor branch July 8, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant